{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录页</title>
    <link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
    <script type="text/javascript" src="{% static 'js/jquery-3.7.1.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/bootstrap.js' %}"></script>
    <style>
        #login-box {
            width: 450px;
            height: 320px;
            margin: 150px auto 0;
            box-sizing: border-box;
            padding: 10px;
            box-shadow: 0 0 15px #ccc;
            border-radius: 10px;
        }

        h2 {
            text-align: center;
        }
    </style>
</head>
<body>
<div id="login-box">
    <h2>后台登录</h2>
    <form method="post" action="{% url 'user_login' %}">
        {#   解决跨站防御攻击            #}
        {% csrf_token %}
        <div class="form-group">
            <label for="username">用户名</label>
            <input type="text" class="form-control" name="username" placeholder="username">
        </div>
        <div class="form-group">
            <label for="password">密码</label>
            <input type="password" class="form-control" name="password" placeholder="password">
        </div>
        <button type="submit" class="btn btn-primary" style="width: 100%;">提交</button>
        <span style="color: red">{{ info }}</span>
    </form>
</div>

</body>
</html>